import uvicorn
from fastapi import FastAPI, Header, Depends, APIRouter
from starlette.middleware.cors import CORSMiddleware
from starlette.staticfiles import StaticFiles

from api.AttendanceAdmin import attendance_admin_router
from api.ClassAdmin import class_admin_router
from api.CourseAdmin import course_admin_router
from api.EmployeeAdmin import employee_admin_router
from api.EmploymentAdmin import employment_admin_router
from api.FileAdmin import file_admin_router
from api.InterviewAdmin import interview_admin_router
from api.NoticeAdmin import notice_admin_router
from api.PermissionAdmin import permission_admin_router
from api.StudentAdmin import student_admin_router
from api.SysDictAdmin import dict_admin_router
from api.UserAdmin import user_admin_router

application = FastAPI()
origins = []
application.mount("/resource", StaticFiles(directory="resource"), name="static")
application.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)


application.include_router(user_admin_router, prefix="/hems", tags=["用户管理服务"])
application.include_router(dict_admin_router, prefix="/hems", tags=["系统字典管理服务"])
application.include_router(permission_admin_router, prefix="/hems", tags=["权限管理服务"])
application.include_router(employee_admin_router, prefix="/hems", tags=["人员管理服务"])
application.include_router(student_admin_router, prefix="/hems", tags=["学生管理服务"])
application.include_router(course_admin_router, prefix="/hems", tags=["课程管理服务"])
application.include_router(class_admin_router, prefix="/hems", tags=["班级管理服务"])
application.include_router(attendance_admin_router, prefix="/hems", tags=["考勤管理服务"])
application.include_router(notice_admin_router, prefix="/hems", tags=["通知管理服务"])
application.include_router(interview_admin_router, prefix="/hems", tags=["面试管理服务"])
application.include_router(employment_admin_router, prefix="/hems", tags=["就业管理服务"])
application.include_router(file_admin_router, prefix="/hems", tags=["文件管理服务"])




if __name__ == "__main__":
    uvicorn.run("app:application", host="0.0.0.0", port=8000)

